
package org.wangnian.demo02_config_file.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

@Component
// 参数配置的数据类型是一个对象或者数组，这个时候才用 @ConfigurationProperties 会是一个比较好的选择！
// 注意，必须实现 set 方法
@ConfigurationProperties(prefix = "config3")
public class Config3 {

    private Map<String, String> map1 = new HashMap<>();

    private Map<String, String> map2 ;

    public Map<String, String> getMap1() {
        return map1;
    }

    public void setMap1(Map<String, String> map1) {
        this.map1 = map1;
    }

    public Map<String, String> getMap2() {
        return map2;
    }

    public void setMap2(Map<String, String> map2) {
        this.map2 = map2;
    }

    @Override
    public String toString() {
        return "Config3{" +
                "map1=" + map1 +
                ", map2=" + map2 +
                '}';
    }
}
